<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="../jquery-easyui-1.3.3/themes/default/easyui.css">
<link rel="stylesheet" type="text/css" href="../jquery-easyui-1.3.3/themes/icon.css">
<script type="text/javascript" src="../jquery-easyui-1.3.3/jquery.min.js"></script>
<script type="text/javascript" src="../jquery-easyui-1.3.3/jquery.easyui.min.js"></script>
<script type="text/javascript" src="../jquery-easyui-1.3.3/locale/easyui-lang-zh_CN.js"></script>
<title>领用单据审核</title>
<script type="text/javascript">

	var ctx = "${pageContext.request.contextPath}"; //设置项目的根路径 
	
	var grid0 = {
	        title : '申领单据列表' , //列表的标题
	        url : 'slxx/list.do', //后台查询接口
	        singleSelect : true , //设置单选
	        hasSelect : true ,    //选择栏
	        paging : true ,		  //分页
	        
	        //设置我们列表的字段 
	        fields : [
	                  '50|id|单据编号',
	                  '50|wpid|物品编号',
	                  '150|wpmc|物品名称',
	                  '100|wpxh|物品型号',
	                  '100|username|申领人',
	                  '50|wpCount|申领数量',
	                  '150|slTime|申领时间'
	                 ],
	        buttons : [
	                    {name:'审核通过',actionName:'pass'},
	                    {name:'回退单据',actionName:'refuse'},
	                  ] ,
	        search : {
	            fields : [
	                        
	                     ],
	                 
	        }          
	    }
	
	function pass(){
		//获取当前选中的行
		var selectedRows= $("#dg0").datagrid('getSelections');
	    var row = selectedRows[0];
	    if(!row){
	        M("请选择一条数据！");
	        return;
	    }
	    var option = {
	        title : '您确定要审核通过吗？',
	        fields : [
	                  {id:'id',name:'单据编号',type:'text'},
                      {id:'wpid',name:'物品编号',type:'text'},
                      {id:'wpmc',name:'物品名称',type:'text'},
                      {id:'wpxh',name:'物品型号',type:'text'},
                      {id:'username',name:'申领人',type:'text'},
                      {id:'wpCount',name:'申领数量',type:'text'},
                      {id:'slTime',name:'申领时间',type:'text'},
                      
	                 ],
	        url : '/slxx/check.do?status=1'      
	    }
	    openWin(500,400,option,row);
	}
	
	function refuse(){
		//获取当前选中的行
		var selectedRows= $("#dg0").datagrid('getSelections');
	    var row = selectedRows[0];
	    if(!row){
	        M("请选择一条数据！");
	        return;
	    }
	    var option = {
	        title : '您确定要回退该单据吗？',
	        fields : [
	                  {id:'id',name:'单据编号',type:'text'},
                      {id:'wpid',name:'物品编号',type:'text'},
                      {id:'wpmc',name:'物品名称',type:'text'},
                      {id:'wpxh',name:'物品型号',type:'text'},
                      {id:'username',name:'申领人',type:'text'},
                      {id:'wpCount',name:'申领数量',type:'text'},
                      {id:'slTime',name:'申领时间',type:'text'},
                      {id:'refuseCause',name:'请填写回退理由（*）',type:'text'},
	                 ],
	        url : '/slxx/check.do?status=2'      
	    }
	    openWin(500,400,option,row);
	}
	


</script>
</head>
<body>
	
	<div id="grid0" style="height:500px;width:100%;"></div>
	
	<script src="../js/very-easyui-1.0.0.js"></script>
</body>
</html>